Skip to content

Add corgea deps offline inventory (scan/graph/explain/diff/sbom/policy)#93

Open
juangaitanv wants to merge 13 commits into
mainfrom
chunk2/deps-offline
Open

Add corgea deps offline inventory (scan/graph/explain/diff/sbom/policy)#93
juangaitanv wants to merge 13 commits into
mainfrom
chunk2/deps-offline

Conversation

@juangaitanv
Copy link
Copy Markdown
Contributor

@juangaitanv juangaitanv commented May 28, 2026

Summary

Chunk 2 of the dependency tooling split (#89). Stacked on #92 (chunk1/harness) — review/merge that first; base will retarget to main once #92 lands.

Adds the fully offline corgea deps inventory surface for npm, Python, and Java:

  • Detects manifests + lockfiles, builds the resolved dependency graph.
  • Evaluates a pinning policy (DEP rules) with table / JSON / SARIF / CycloneDX output.
  • Subcommands: scan, graph, explain, diff, sbom, policy.
  • No token, no config, no network — wired into main.rs with no auth/token check.

Out of scope (chunk 3)

The network surface stays deferred: deps verify, registry freshness, --check-cve / vuln-api client, the vuln-api-stub binary, and the npm/pip/etc. install wrappers.

Coverage

83 unit + integration tests. Overall line coverage 13% → 36% (well above the 13% floor from chunk 1).

Test plan

  • CI green once Add ./harness quality contract + CI coverage gate #92 merges and this retargets to main
  • Local: ./harness ci passes (clippy strict, fmt, tests + coverage)
  • corgea deps scan / graph / explain / diff / sbom / policy run with no token or config present
  • Offline contract holds: no network calls in any deps subcommand

Demo

https://corgea-cli-deps.vercel.app/

Zero-dep bash runner (check/fix/lint/test/audit/coverage/pre-commit/ci/
post-edit/setup-hooks/suppressions/install) wrapping cargo + git.

./harness ci is the single source of truth for the strict gate: clippy
-D warnings, fmt check, cargo audit, and cargo-llvm-cov tests with a
--fail-under-lines floor (13% baseline, will ratchet up as more code
ships with tests).

GitHub Actions test.yml runs the same gate so cloud CI matches local.

AGENTS.md documents the commands. CLAUDE.md and .claude/ are gitignored
so personal agent configs stay local.
Reformats per rustfmt and applies clippy lints (needless_return,
collapsible_if, eq_ignore_ascii_case, double_ended_iterator_last,
print_with_newline, contains_key, needless_late_init,
useless_format/vec, borrowed_box, etc.) so ./harness ci's strict
clippy gate passes.

Adds unit tests for utils::api::{is_jwt, auth_headers,
check_for_warnings} so the coverage gate isn't sitting on 0%.

Pure refactor + tests: no behavior change.
…able

Pre-commit now mirrors CI (strict clippy + fmt --check + tests) instead
of running autofix, which could rewrite the working tree behind the
commit. Drops the unimplemented `install` from harness docs.

Extracts `should_warn_deprecated` from `check_for_warnings` so the 299
deprecation contract is covered by tests; deleting the branch now
fails the suite.
Offline dependency inventory for npm, Python, and Java: detects manifests
and lockfiles, builds the resolved graph, and evaluates a pinning policy
(DEP rules) with table/JSON/SARIF/CycloneDX output. Fully offline — no
token or network.

Carved out of #89 as chunk2 (stacks on the chunk1 harness branch). Excludes
the network surface deferred to chunk3: `deps verify`, registry freshness,
--check-cve / vuln-api, the vuln-api-stub binary, and the npm/pip/etc.
install wrappers.

Wires `corgea deps <subcommand>` into main.rs with no auth/token check.
Adds 83 unit + integration tests; overall line coverage 13% -> 36%.
@juangaitanv juangaitanv reopened this May 28, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/ecosystems/npm.rs Outdated
Comment thread src/deps/ecosystems/pypi.rs Outdated
cursor[bot]
cursor Bot previously requested changes May 28, 2026
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/run.rs Outdated
Comment thread src/deps/ecosystems/npm.rs
Comment thread src/deps/ecosystems/npm.rs Outdated
Comment thread src/deps/ecosystems/npm.rs Outdated
Comment thread src/deps/ecosystems/pypi.rs Outdated
Base automatically changed from chunk1/harness to main June 8, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant